add_executable(MakeTable MakeTable.cxx)
add_custom_command(
        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
        COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
        DEPENDS MakeTable
)

add_library(MathFunctions SHARED
        mysqrt.cxx
        ${CMAKE_CURRENT_BINARY_DIR}/Table.h
)

target_include_directories(MathFunctions
        INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
        PRIVATE   ${CMAKE_CURRENT_BINARY_DIR}
        )

install(TARGETS MathFunctions DESTINATION lib)
install(FILES MathFunctions.h DESTINATION include)
set_target_properties(MathFunctions PROPERTIES INSTALL_RPATH $ORIGIN/../lib)